package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 病历档案新增和修改
 *
 * @author zhuqiang
 * @version 2015年7月22日 - 下午8:50:21
 */
public class MedicalHistoryMergeRequest extends Request{

	private static final long serialVersionUID = 5656653910419586737L;
	
	private Integer id;
	private Integer userId;
	private String imgUrl;
	private String checkTime;
	private String medicalDetail;
	private Integer status;
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.id = requestInfo.getIntParameter(ApiUrlParamEnum.id.getParamName(), 0);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.imgUrl = requestInfo.getParameter(ApiUrlParamEnum.medicalImgUrl.getParamName(), "");
		this.checkTime = requestInfo.getParameter(ApiUrlParamEnum.medicalCheckTime.getParamName(), "");
		this.medicalDetail = requestInfo.getParameter(ApiUrlParamEnum.medicalDetail.getParamName(), "");
		this.status = requestInfo.getIntParameter(ApiUrlParamEnum.status.getParamName(), -1);
		
		if(userId < 1){
			throw new RequestIllegalException("error userId: " + userId);
		}
		if(status < 0){
			throw new RequestIllegalException("error status: " + status);
		}
	}

	
	public Integer getStatus() {
		return status;
	}


	public void setStatus(Integer status) {
		this.status = status;
	}


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public String getCheckTime() {
		return checkTime;
	}

	public void setCheckTime(String checkTime) {
		this.checkTime = checkTime;
	}

	public String getMedicalDetail() {
		return medicalDetail;
	}

	public void setMedicalDetail(String medicalDetail) {
		this.medicalDetail = medicalDetail;
	}

}
